package game;

public class ArrayBoard extends TicTacToeBoard {
	
	public final static int X = 0;
	public final static int O = 1;
	public final static int EMPTY = -1; 
	
	private int [] grid; 
	public boolean gameOver = false; 

	public int getValue(int s){
		return grid[s]; 
	}

	protected void makeMove(int s, int m){
			grid[s] = m;      
	}

	public void reset(){
		if(gameOver = true){
			for(int i = 0; i < grid.length; i++){
				grid[i] = EMPTY; 
			}
		}
	}
	
	public boolean checkFree(int s){
		if(grid[s] == EMPTY){
			return true; 
		} else {
			return false; 
		}
	}

	public void createGrid(){ 
		grid = new int[9]; 
		for(int i = 0; i < grid.length; i++){
			grid[i] = EMPTY; 
		} 
	}
}